import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
	state: {
		tabbar_items:[

			{
				title: "发布",
				img: require("@/tabs/newPost/NewPost.png"),
				img_active: require("@/tabs/newPost_active/NewPost_active.png"),
				page: "/pages/NewPost/NewPost",
				active: false,
				title_en:"new_post"
			},
			{
				title: "首页",
				img: require("@/tabs/home/Home.png"),
				img_active: require("@/tabs/home_active/Home_active.png"),
				page: "/pages/Home/Home",
				active: true,
				title_en:"home"
			},
			{
				title: "我的",
				img: require("@/tabs/mine/User.png"),
				img_active: require("@/tabs/mine_active/User_active.png"),
				page: "/pages/Mine/Mine",
				active: false,
				title_en:"mine"
			}
		],
		tool_list: [{
			title: "排列方式",
		
			items: [{
				name: "大图",
				icon: "minus-square-fill"
			}, {
				name: "小图",
				icon: "grid"
			}, {
				name: "列表",
				icon: "list"
			}]
		}, {
			title: "排序方式",
		
			items: [{
				name: "时间（正序）",
				icon: "clock",
		
			}, {
				name: "时间（逆序）",
				icon: "clock",
		
			}, {
				name: "热度（正序）",
				icon: "thumb-up-fill"
			}, {
				name: "热度（逆序）",
				icon: "thumb-down-fill"
			}]
		}]
	},
	mutations: {
		increment(state) {
			state.count++
		}
	},
	getters: {
		
		setting() {
			return [{
				type: Boolean,
				name: "条专栏动画",
				default: false
			}]
		}
	},
	mutations:{
		change_active(state,name){
			
			state.tabbar_items.forEach(function(element) {
				element.active = false;
				if(element.title_en == name ){
					element.active = true;
				}
			}, this);
		}
	}
})